<html>
<head>
<meta charset="UTF-8">
<title>数据运维日志列表</title>
	<link id="easyuiTheme" href="../../static/easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css"/>
	<link href="../../static/easyui/themes/icon.css" rel="stylesheet" type="text/css"/>
	<script src="../../static/easyui/jquery.min.js" type="text/javascript"></script>
	<script src="../../static/easyui/jquery.cookie.js" type="text/javascript"></script>
	<script src="../../static/easyui/ui-theme.js" type="text/javascript"></script>
	<script src="../../static/easyui/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../static/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
	<script src="../../static/plugin/assets/jslib.util.js" type="text/javascript"></script>
	<script src="../../static/plugin/assets/jslib.jquery.ajax.js" type="text/javascript"></script>
	<script src="../../static/plugin/assets/jslib.easyui.util.js" type="text/javascript"></script>
	<script src="../../ffres/dict/all.js" type="text/javascript"></script>
	<link href="../../static/easyui/themes/frameless.css" rel="stylesheet" type="text/css"/>
	<a href="" target="_blank" id="commonLink" name="commonLink"></a>
</head>
<script type="text/javascript">

	$(function() {
		addTitle("数据修改日志");
	});

	function doAdd(){
		JLEUtil.createModalWin('新增', 'DboSqlLogAdd.html');
	}
	
	function doUpdate() {
		var row = $('#dg').datagrid('getSelected');
		if (row){
			JLEUtil.createModalWin('修改', 'DboSqlLogUpdate.html?' + 'recordKeyid=' + row.recordKeyid);
		} else {
			$.messager.alert('提示','请选择一条记录！','info');
		}
	}
	
	function doDelete(){
		var row = $('#dg').datagrid('getSelected');
		if (row) {
			$.messager.confirm('删除提示', '你确定要删除这条记录?', function(r){
				if (r){
					var jsonData = JSON.parse('{'+'"recordKeyid":"' + row.recordKeyid + '"'+'}');
					$.restfulDelete('../../api/dbo/sql/log', jsonData, function(data) {
						$.messager.alert('提示','记录删除成功!','info');
						$('#dg').datagrid('reload');
					});
				}
			});
		} else {
			$.messager.alert('提示','请选择一条记录！','info');
		}
	}

	function doView(){
		var row = $('#dg').datagrid('getSelected');
		if (row) {
			JLEUtil.createModalWin('详情','DboSqlLogView.html?' + '&recordKeyid=' + row.recordKeyid);
		} else {
			$.messager.alert('提示','请选择一条记录！','info');
		}
	}	

	function reloadList(){
		$('#dg').datagrid('reload');
		JLEUtil.closewin();
	};
	function closeForm() {
		window.parent.JLEUtil.closewin();
	}
</script>
</head>
<body class="easyui-layout">
<div data-options="region:'north'" style="height: 85px; background: #f4f4f4;">
	<div data-options="region:'north'" style="margin-bottom: 10px;" >
		<div class="esaas-info-title2" style="height: 25px;background-color: #205081;" >
			<div style="color:#ffffff;margin-left:5px;font-weight: bold;text-align: left;font-size: 16px;">数据运维日志</div>
			<a class="easyui-menubutton" style="position:absolute;right: 8px;top: 1px;width:25px;height: 25px;background-image: url('../../static/easyui/themes/icons/cancel6.png')"
			   onclick="closeForm()">
			</a>
		</div>
	</div>
	<form id="searchForm">
		<table>
			<tr>
				<td class="searchTd">&nbsp;数据记录标识：</td>
				<td><input name="recordKeyid" id="recordKeyid"/></td>
				<td><a class="easyui-linkbutton" href="javascript:void(0);" onclick="JLEUtil.queryForm('searchForm','dg','../../api/dbo/sql/logs');">查找</a></td>
				<td><a class="easyui-linkbutton" href="javascript:void(0);" onclick="JLEUtil.clearForm('searchForm');">清空</a></td>
			</tr>
		</table>
	</form>
</div>
<div data-options="region:'center',split:false">
<table id="dg" class="easyui-datagrid" title="" style="width:100%;height:100%"
			data-options="singleSelect:true,collapsible:true,url:'../../api/dbo/sql/logs/'+$.getUrlParam('dsCode'),method:'post'"
			toolbar="#tb"
		title="Load Data" 
		rownumbers="true" pagination="true" pageSize="20">
		<thead>
			<tr>
				<th data-options="field:'recordKeyid',resizable:true,hidden:true" >数据记录标识</th>
				<th data-options="field:'startTime',resizable:true" >执行时间</th>
				<th data-options="field:'endTime',resizable:true" >结束时间</th>
				<th data-options="field:'dboRemarks',resizable:true" >数据运维说明</th>
				<th data-options="field:'dsCode',resizable:true" >数据源代码</th>
				<th data-options="field:'dboSqlContent',resizable:true" >数据运维语句</th>
				<th data-options="field:'dboResult',resizable:true" >数据运维执行结果</th>
				<th data-options="field:'dboAffectedNum',resizable:true" >数据运维影响记录数</th>
				<th data-options="field:'dboErrMsg',resizable:true" >数据运维错误信息</th>
				<th data-options="field:'costTime',resizable:true" >执行时长（秒）</th>
				<th data-options="field:'operUserid',resizable:true" >操作人</th>

			</tr>
		</thead>
	</table>
</div>
<div id="tb" style="padding:1px">
	<div style="margin-bottom:2px">
		<a href="javascript:doView()" class="easyui-linkbutton" iconCls="icon-ok" plain="true">查看</a>
	</div>
</div>
</body>
</html>
